home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
dev
/
basic
/
BlitzGUIGen18.lha
/
RIGTMenusLib.doc
< prev
next >
Wrap
Text File
|
1995-05-25
|
7KB
|
174 lines
-----------------------------------------------------------------------------
==== RI GadTools Menu Library v1.0ß ====
-----------------------------------------------------------------------------
Written By Stephen McNamara
©1995 Leading Edge Software
This library provides access to the GadTools library functions for
setting up and layouting out menustrips. Because of its use of Gadtools,
this library is for us with OS2 and above.
Users of the current Acid library should have no problems converting to
this library, since it has been designed so that the only major differences
between them are the slight command name changes. The benefit of using
this library is that GadTools takes over all positioning of menuitems, and
will automatically take account of things like font sensitivity and items
going off screen. You'll also get that nice OS2 feeling to your menuitems,
including those luvly bar items.
If you wish to have proper GadTools menus you need to open your windows
with the NewLookMenus flag set. Do this by either specifying NewLookMenus
in your taglist for WindowTags, or by adding the value $200000 to your
window flags when you call the Window command.
The library has its own Blitz2 object associated with it: GTMenuList,
which looks like:
Newtype.GTMenuList
*MenuList
*MenuLookup
numitems.w
End Newtype
The latest version of the LES Debugger has this object built in for
convience.
Command List:
GTMenuTitle GTMenuList#,menu,title$
GTMenuItem GTMenuList#,flags,menu,item[,itemtext$[,shortcut$]]
GTSubItem GTMenuList#,flags,menu,item,subitem[,itemtext$[,shortcut$]]
CreateMenuStrip GTMenuList#
GTSetMenu GTMenuList#
GTUnSetMenu
status=GTMenuChecked (GTMenuList#,menu,item[,subitem])
GTSetMenuChecked GTMenuList#,menu,item[,subitem],Off|On
GTFreeMenu GTMenuList#,menu[,item[,subitem]]
Statement: GTMenuTitle
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTMenuTitle GTMenuList#,menu,title$
This creates the specified menutitle in the GTMenuList given. The text
to display for the title is given in title$
This command fails if 'menu' is greater than 0 but menu title menu-1 hasn't
been defined
Statement: GTMenuItem
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTMenuItem GTMenuList#,flags,menu,item[,itemtext$[,shortcut$]]
This creates the specified menuitem in the GTMenuList. This command
works the same as the Acid command MenuItem *except* that the flags
parameter is different. The flags in this library refer to the flag
definitions found in the Amiga Include files. Note also that you cannot
do mutual exclude menuitems using this library (yet).
You'll notice that the itemtext$ parameter is optional - if you leave
this out you'll get a bar item. This bar item will automatically fit
perfectly across the menu width and will be unselectable by the user.
This command fails in the specifed menu hasn't been defined, or the
item is greater than 0 and item-1 is undefined.
Statement: GTSubItem
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTSubItem GTMenuList#,flags,menu,item,subitem[,itemtext$[,shortcut$]]
Creates the specified subitem in the GTMenuList. Need I say more? The
flags are given as defined in the Amiga Include files.
You'll notice that the itemtext$ parameter is optional - if you leave
this out you'll get a bar item. This bar item will automatically fit
perfectly across the menu width and will be unselectable by the user.
Statement: CreateMenuStrip
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: CreateMenuStrip GTMenuList#
Creates the actual GadTools menustrip from a GTMenuList object. When you
call commands like GTMenuTitle the work is performed on an internal list to
the library - not an actual menulist. Thus this command translates the
internal list into a menulist and performs all GadTools formatting etc.
This command is invoked automatically if it has not been called before
you call GTSetMenu.
Note also that you must have a currently used screen object to call this
command since GadTools needs to know what screen to format your menus for
(font sensitivity). Also note that you can call this command over and over
again for a given object - thus after adding new items you can call it
again to make this items appear in the menulist. WARNING before calling
this command make sure that the GTMenuList given is not attached to a
window - problems will occur (corrupt menu items) if you call this item
whilst the menulist is attached. Use GTUnSetMenu to remove this menulist
from a window.
Statement: GTSetMenu
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTSetMenu GTMenuList#,Window#
Attached the specified GTMenuList to the specified windows. If the given
GTMenuList object has not had CreateMenuStrip called on it, CreateMenuStrip
is automatically invoked to calculate the menulist.
Statement: GTUnSetMenu
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTUnSetMenu
This command removes the menulist from the current window. You must call
this function before you call CreateMenuStrip IF you have already set the
menulist to a window (come again? :) ).
Statement: GTMenuChecked
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: status=GTMenuChecked (GTMenuList#,menu,item[,subitem])
This commamd is used in conjunction with menuitems that have a check
mark. If the item (or subitem) is currently checked (e.g. a tick appears
in front of its text in the menu) then this command returns -1, else it
returns 0. Note that you must have called either CreateMenuStrip or
GTSetMenu before you use this command.
Statement: GTSetMenuChecked
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTSetMenuChecked GTMenuList#,menu,item[,subitem],Off|On
This sets the tick mark on the selected item (or subitem) to the status
supplied (on or off). The same rules apply to this command as
GTMenuChecked.
Statement: GTFreeMenu
------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: GTFreeMenu GTMenuList#,menu[,item[,subitem]]
This frees the selected menu title/item/subitem from the libraries
internal menu list. This change will not be reflected in the actual
menulist created by CreateMenuStrip until you recall CreateMenuStrip.
Deleting an item automatically causes its decendants to be deleted. Eg.
deleting a menu title will cause all items that belong to it to be deleted,
deleting a menu item will cause all subitems that belong to it be deleted.